<template>
	<!-- 消防安全日查记录表 -->
	<view class="">
		<view class="files">
			<view class="tabs">
				<fui-list bottomBorder title="基本信息">
					<view class="tab">

						<fui-list-cell>
							<text>登记人</text>
							<text class="fui-text__explain">{{inspectionStaff.name}}</text>
						</fui-list-cell>

						<fui-list-cell>
							<text>时间</text>
							<text class="fui-text__explain">{{inspectionStaff.data}}</text>
						</fui-list-cell>

					</view>
				</fui-list>

				<fui-list bottomBorder title="防火安全">
					<view class="tab">
						<fui-input readonly required label="施工现场防火管理制度" textAlign="right"></fui-input>
						<fui-input readonly label="三级防火责任制，防火标志和宣传" textAlign="right"></fui-input>
						<u--textarea v-model="ops.c1" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input readonly required label="严格执行“十不烧”规定" textAlign="right"></fui-input>
						<u--textarea v-model="ops.c2" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input required readonly label="防火领导小组人员" textAlign="right"></fui-input>
						<fui-input readonly label="防火器材维护管理人" textAlign="right"></fui-input>
						<u--textarea v-model="ops.c3" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

					</view>
				</fui-list>
				<fui-list bottomBorder title="易燃物">
					<view class="tab">
						<fui-input readonly required label="焊割工持证情况，明火作业审批资料。" textAlign="right"></fui-input>
						<u--textarea v-model="opsone.c1" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input readonly required label="木工间应有禁烟牌，易燃物及时清除。" textAlign="right"></fui-input>
						<u--textarea v-model="opsone.c2" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input required readonly label="易燃物与伙房等处的明火应有安全距离" textAlign="right"></fui-input>
						<u--textarea v-model="opsone.c3" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

					</view>
				</fui-list>

				<fui-list bottomBorder title="防火标志、器材数量">
					<view class="tab">

						<fui-input readonly required label="危险仓库（每100m2配四只种类合适的灭火器）" textAlign="right"></fui-input>
						<u--textarea v-model="opstow.c1" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input readonly required label="油漆间、木工间、木料库" textAlign="right"></fui-input>
						<fui-input readonly label="每100m配四只种类合适的灭火器" textAlign="right"></fui-input>
						<u--textarea v-model="opstow.c2" placeholder="请输入检查记录" count maxlength="250"></u--textarea>
						<fui-input readonly required label="大型临时设施应备有" textAlign="right"></fui-input>
						<fui-input readonly label="专供消防用的太平桶、积水桶（池）、黄沙池等" textAlign="right"></fui-input>
						<u--textarea v-model="opstow.c3" placeholder="请输入检查记录" count maxlength="250"></u--textarea>
						<fui-input required readonly label="配电间（配有种类合适的灭火器）" textAlign="right"></fui-input>
						<u--textarea v-model="opstow.c4" placeholder="请输入检查记录" count maxlength="250"></u--textarea>
						<fui-input required readonly label="生活区（每100m2配二只灭火器）" textAlign="right"></fui-input>
						<fui-input readonly label="伙房屋屋面应用防火材料" textAlign="right"></fui-input>
						<fui-input readonly label="每50m2设灭火器二只" textAlign="right"></fui-input>
						<u--textarea v-model="opstow.c5" placeholder="请输入检查记录" count maxlength="250"></u--textarea>
						<fui-input required readonly label="熔化沥青按规定配消防器材" textAlign="right"></fui-input>
						<u--textarea v-model="opstow.c6" placeholder="请输入检查记录" count maxlength="250"></u--textarea>
						<fui-input required readonly label="有否用电炉及大容量灯具烘烤" textAlign="right"></fui-input>
						<u--textarea v-model="opstow.c7" placeholder="请输入检查记录" count maxlength="250"></u--textarea>
					</view>
				</fui-list>

				<fui-list bottomBorder title="特殊现场防火">
					<view class="tab">
						<fui-input readonly required label="二十四米高度以上的高层建筑物施工现场" textAlign="right"></fui-input>
						<fui-input readonly label="应设置有足够扬程的高压水泵或其他防火设备" textAlign="right"></fui-input>
						<u--textarea v-model="opsfour.c1" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input readonly required label="高层施工应配专职防火监护人。" textAlign="right"></fui-input>
						<!-- <fui-input readonly required v-model="ops.c2" label="专供消防用的太平桶、积水桶（池）、黄沙池等" textAlign="right"></fui-input> -->
						<u--textarea v-model="opsfour.c2" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input required readonly label="要明确规定吸烟点" textAlign="right"></fui-input>
						<u--textarea v-model="opsfour.c3" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input required readonly label="高层建筑施工现场上下要有通讯报警装置" textAlign="right"></fui-input>
						<u--textarea v-model="opsfour.c4" placeholder="请输入检查记录" count maxlength="250"></u--textarea>

						<fui-input required readonly label="严禁在层顶用明火熔化柏油" textAlign="right"></fui-input>
						<u--textarea v-model="opsfour.c5" placeholder="请输入检查记录" count maxlength="250"></u--textarea>
					</view>
				</fui-list>

				<fui-list bottomBorder title="检查结果">
					<view class="tab">
						<fui-input readonly required label="检查结论" textAlign="right"></fui-input>
						<u--textarea v-model="opsfive.c1" placeholder="请输入检查结论" count maxlength="250"></u--textarea>

						<fui-input readonly label="隐患整改" textAlign="right"></fui-input>
						<fui-input required v-model="opsfive.c2" placeholder="请输入整改人" label="整改人"
							textAlign="right"></fui-input>
						<fui-input placeholder="请选择" required @click="onSelectTime(1)" readonly v-model="opsfive.c3"
							label="整改日期" textAlign="right"></fui-input>
						<u--textarea placeholder="请输入隐患整改" v-model="opsfive.c4" count maxlength="250"></u--textarea>

						<fui-input readonly label="复查意见" textAlign="right"></fui-input>
						<fui-input placeholder="请输入复查人" required v-model="opsfive.c5" label="复查人"
							textAlign="right"></fui-input>
						<fui-input placeholder="请选择" required readonly @click="onSelectTime(2)" v-model="opsfive.c6"
							label="复查日期" textAlign="right"></fui-input>
						<u--textarea placeholder="请输入复查意见" v-model="opsfive.c7" count maxlength="250"></u--textarea>

					</view>
				</fui-list>
			</view>



			<view class="tab_ops">
				<!-- 	<view style="width: 100%; display: flex; justify-content: space-between;">
					<fui-button btnSize="small" >巡查人员签字</fui-button>
					<fui-button btnSize="small"  >安全主管签字</fui-button>
				</view> -->
				<view style="padding-top: 40rpx;">
					<fui-button @click="submit" type="success">提交</fui-button>
				</view>
			</view>
			<view>
				<u-picker @confirm="onOpsOne" @cancel="showOpsOne = !showOpsOne" :show="showOpsOne"
					:columns="columnsOne"></u-picker>
			</view>
			<view>
				<u-datetime-picker :minDate="minDate" :maxDate="maxDate" :formatter="formatter" @confirm="onTime"
					@cancel="showTime =!showTime" :show="showTime" mode="datetime"></u-datetime-picker>
			</view>
		</view>
	</view>
</template>

<script>
	import moment, {
		duration
	} from "moment"
	import {
		BASE_IP
	} from '@/common/http/url.js'
	// import test from "../../../uni_modules/uview-plus/libs/function/test"
	// import text from "../../../uni_modules/uview-plus/libs/config/props/text"
	import tools from "@/tools/tools.js"
	export default {
		name: "buildingFireProtection",
		data() {
			return {
				user: "",
				inspectionStaff: {
					name: "",
					data: "",
					time: ""
				},
				v1: "",
				v2: "",
				columnsOne: [
					['干粉灭火器', '推车式灭火器', '消防沙箱', '防毒面具', '防护服', '应急照明', '电工器材', '急救箱及药品', '应急通讯设备', '泄漏吸附材料', '堵漏材料']
				],
				showOpsOne: false,
				showTime: false,
				regime: "",
				year: "",
				month: "",
				day: "",
				ops: {
					c1: "", //消防设施名称
					c2: "", //部门
					c3: "", //位置
					c4: "", //数量
					c5: "", //状态
					c6: "", //责任人
					c7: "", //备注
				},
				opsone: {
					c1: "", //消防设施名称
					c2: "", //部门
					c3: "", //设置位置
					c4: "", //数量
					c5: "", //器材维护保养状况
					c6: "", //责任人
					c7: "", //备注
					c8: "",
					c9: "",
					c10: ""
				},
				opstow: {
					c1: "", //消防设施名称
					c2: "", //部门
					c3: "", //设置位置
					c4: "", //数量
					c5: "", //状态
					c6: "", //送检日期
					c7: "",
				},
				opsfour: {
					c1: "", //消防设施名称
					c2: "", //部门
					c3: "", //设置位置
					c4: "", //数量
					c5: "", //状态
					c6: "", //送检日期
				},
				opsfive: {
					c1: "", //消防设施名称
					c2: "", //部门
					c3: "", //设置位置
					c4: "", //数量
					c5: "", //状态
					c6: "", //送检日期
					c7: "", //送检日期
				},
				time: "",
				index: 0,
				minDate: null,
				maxDate: null,
				tid: 0,
				isSubmit: false,
				preset: ""
			}
		},
		mounted() {
			this.calculateMinMaxDates();
		},
		methods: {
			/**
			 * 
			 * @param {Object} path 转入要签字的路径
			 */
			onSignatures(path) {
				let user = uni.getStorageSync("user")
				if (user.signature == "" || user.signature == undefined || user.signature == null) {
					uni.showModal({
						title: "提示",
						content: "用户未上传签名请前往“预设功能-添加操作员-输入账号-添加签名”，如果已添加操作员上传签名即可",
						showCancel: false,
						success: (res) => {
							if (res.confirm) {
								return
							}
						}
					})
					return
				}
				let docPath = path
				let url = BASE_IP + user.signature
				tools.upSignatures(path, user.signature)
				// console.log(url)
				// let _this = this
				// uni.downloadFile({ //下载
				// 	url: url, //图片下载地址
				// 	success: res => {
				// 		if (res.statusCode === 200) {
				// 			uni.saveFile({
				// 				tempFilePath: res.tempFilePath,
				// 				success: (r) => {
				// 					console.log(r)
				// 					_this.upSignatures(r.savedFilePath, docPath)
				// 				}
				// 			})
				// 		}
				// 	}
				// });
			},
			/** 签字函数
			 * @param {Object} filePath 签字图片
			 * @param {Object} docPath  要签字的文档
			 */
			upSignatures(filePath, docPath) {
				console.log(filePath, docPath)
				let user = uni.getStorageSync("user")
				let url = BASE_IP + "pc/regulatory/signature/word"
				uni.uploadFile({
					header: {
						"Authorization": user.token,
					},
					name: "file",
					url: url,
					formData: {
						"unitId": user.unitId,
						"path": docPath
					},
					filePath: filePath,
					success: (res) => {
						if (res.statusCode == 500) {
							uni.showToast({
								title: "上传失败",
								icon: "error"
							})
							return
						}
					},
					fail: (res) => {
						uni.showToast({
							title: "上传失败,请重试",
							icon: "error"
						})
					}
				})
			},
			/**
			 * 盖章
			 * @param {Object} path 转入要盖章的文件路径
			 */
			onSeal(path) {
				let pralldata = uni.getStorageSync("pralldata")
				// console.log(pralldata)
				let docPath = path
				if (pralldata.unitFireSeal == "" || pralldata.unitFireSeal == undefined) {
					uni.showModal({
						title: "提示",
						content: "单位未上传消防专用章",
						showCancel: false,
						success: (res) => {
							if (res.confirm) {
								return
							}
						}
					})
					return
				}
				let url = BASE_IP + pralldata.unitFireSeal
				tools.upLoadSeal(path, pralldata.unitFireSeal)
				// console.log(url)
				// uni.downloadFile({ //下载
				// 	url: url, //图片下载地址
				// 	success: res => {
				// 		if (res.statusCode === 200) {
				// 			uni.saveFile({
				// 				tempFilePath: res.tempFilePath,
				// 				success: (r) => {
				// 					// console.log(r)
				// 					this.upLoadSeal(r.savedFilePath, docPath)
				// 				}
				// 			})
				// 		}
				// 	}
				// });
			},
			/** 盖章函数
			 * @param {Object} filePath 印章图片
			 * @param {Object} docPath  要盖章的文档
			 */
			upLoadSeal(filePath, docPath) {
				let user = uni.getStorageSync("user")
				let url = BASE_IP + "pc/regulatory/update/word"
				uni.uploadFile({
					header: {
						"Authorization": user.token,
					},
					name: "file",
					url: url,
					formData: {
						"unitId": user.unitId,
						"path": docPath
					},
					filePath: filePath,
					success: (res) => {
						// console.log(res)
						if (res.statusCode == 500) {
							uni.showToast({
								title: "盖章失败",
								icon: "error"
							})
							return
						}
						if (res.statusCode == 404) {
							uni.showToast({
								title: "盖章失败",
								icon: "error"
							})
							return
						}
					},
					fail: (res) => {
						uni.showToast({
							title: "盖章失败,请重试",
							icon: "error"
						})
					}
				})
			},
			onSelectTime(index) {
				this.tid = index
				this.showTime = !this.showTime
			},
			calculateMinMaxDates() {
				const today = moment().startOf("day");
				const minDate = today.clone().subtract(60, "days");
				const maxDate = today.clone().startOf("day");

				this.minDate = minDate.valueOf();
				this.maxDate = maxDate.valueOf();
			},
			formatter(type, value) {
				if (type === 'year') {
					return `${value}年`
				}
				if (type === 'month') {
					return `${value}月`
				}
				if (type === 'day') {
					return `${value}日`
				}
				if (type === 'hour') {
					return `${value}时`;
				}
				if (type === 'minute') {
					return `${value}分`;
				}
				return value
			},
			onTime(res) {
				const timestamp = res.value
				const formattedDateTime = moment(timestamp).format("YYYY-MM-DD HH:mm:ss");
				switch (this.tid) {
					case 1: {
						this.opsfive.c3 = formattedDateTime
						break
					}
					case 2: {
						this.opsfive.c6 = formattedDateTime
						break
					}
				}
				this.showTime = !this.showTime
				// console.log(formattedDateTime)
			},
			onShowOps(index) {
				this.index = index
				this.showOpsOne = !this.showOpsOne
			},
			onOpsOne(res) {
				// this.situation = res.value[0]
				// console.log(res)
				switch (this.index) {
					case 1: {
						this.ops.c1 = res.value[0]
						break
					}
					case 2: {
						this.opsone.c1 = res.value[0]
						break
					}
					case 3: {
						this.opstow.c1 = res.value[0]
						break
					}

				}
				// this.faultSituation.c9 = res.value[0]
				this.showOpsOne = !this.showOpsOne
			},
			submit() {

				if (this.isSubmit) {
					uni.showToast({
						title: "请勿重复提交",
						icon: "error"
					})
					return
				}
				let url = BASE_IP + "pc/record/record/fire/fireDailyCheckRecordGormFireSafety"

				let classifyId = this.regime.classifyId
				// console.log(this.regime)
				let user = uni.getStorageSync("user")

				if (this.ops.c1 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.ops.c2 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.ops.c3 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsone.c1 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsone.c2 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsone.c3 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opstow.c7 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opstow.c1 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opstow.c2 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opstow.c3 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opstow.c4 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opstow.c5 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opstow.c6 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfour.c1 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfour.c2 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfour.c3 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfour.c4 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfour.c5 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				// if(this.opsfour.c6 == ""){
				// 	uni.showToast({
				// 		title:"19表单填写不完整",
				// 		icon:"error"
				// 	})
				// 	return
				// }
				if (this.opsfive.c1 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfive.c2 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfive.c3 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfive.c4 == "") {
					uni.showToast({
						title: "表单填写不完整",
						icon: "error"
					})
					return
				}
				if (this.opsfive.c5 == "") {
					this.opsfive.c7 = "无"
					return
				}
				if (this.opsfive.c6 == "") {
					this.opsfive.c7 = "无"
					return
				}
				if (this.opsfive.c7 == "") {
					this.opsfive.c7 = "无"
					return
				}


				let json1 = {
					name: this.inspectionStaff.name,
					data: this.inspectionStaff.data,
					a1: this.ops.c1,
					a2: this.ops.c2,
					a3: this.ops.c3,
					b1: this.opsone.c1,
					b2: this.opsone.c2,
					b3: this.opsone.c3,
					c1: this.opstow.c1,
					c2: this.opstow.c2,
					c3: this.opstow.c3,
					c4: this.opstow.c4,
					c5: this.opstow.c5,
					c6: this.opstow.c6,
					c7: this.opstow.c7,
					d1: this.opsfour.c1,
					d2: this.opsfour.c2,
					d3: this.opsfour.c3,
					d4: this.opsfour.c4,
					d5: this.opsfour.c5,
					d6: this.opsfour.c6,
					e1: this.opsfive.c1,
					e2: this.opsfive.c2,
					e3: this.opsfive.c3,
					e4: this.opsfive.c4,
					e5: this.opsfive.c5,
					e6: this.opsfive.c6,
					e7: this.opsfive.c7,
				}

				console.log(JSON.stringify(json1))
				
				let flag_storage = true
				// let user = uni.getStorageSync("user")
				if (user.signature == "" || user.signature == undefined || user.signature == null) {
					uni.showModal({
						title: "提示",
						content: "用户未上传签名请前往“预设功能-添加操作员-输入账号-添加签名”，如果已添加操作员上传签名即可",
						showCancel: false,
						success: (res) => {
							if (res.confirm) {
								flag_storage = false
								uni.navigateTo({
									url: "/pages/preinstall/preinstall"
								})
								return
							}
						}
					})
					return
				}
				
				if (!flag_storage) {
					return
				}
				
				let pralldata = this.preset
				console.log(pralldata)
				let falg_seal = true
				if (pralldata.unitFireSeal == "" || pralldata.unitFireSeal == undefined) {
					uni.showModal({
						title: "提示",
						content: "单位未上传消防专用章,请前往“预设功能-单位消防专用章”上传",
						showCancel: false,
						success: (res) => {
							if (res.confirm) {
								falg_seal = false
								uni.navigateTo({
									url: "/pages/preinstall/preinstall"
								})
								return
							}
						}
					})
					return
				}
				
				if (!falg_seal) {
					return
				}
				uni.showLoading({
					title: "正在提交"
				})
				this.isSubmit = !this.isSubmit
				uni.request({
					url: url,
					header: {
						"Authorization": user.token,
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					data: {
						unitId: user.unitId,
						name: user.nickName,
						classifyId: classifyId,
						json: JSON.stringify(json1),
						uuid : user.uuid
					},
					method: "POST",
					success: (res) => {
						console.log(res)

						if (res.statusCode == 200) {
							uni.showToast({
								title: "上传成功",
								icon: "success"
							})
							// this.onSeal(res.data.path)
							// this.onSignatures(res.data.path)
							setTimeout((r) => {
								uni.navigateBack({
									delta: 1,
									success: function() {
										const pages = getCurrentPages(); //获取当前页面栈
										const prevPage = pages[pages.length -
										1]; //获取上一个页面实例对象
										prevPage.getCollapseDatas(); //调用上一个页面的onLoad方法
									}
								});
							}, 1500)
							return
						}

						if (res.statusCode == 500) {
							uni.showToast({
								title: "上传失败",
								icon: "error"
							})
							this.isSubmit =!this.isSubmit
							return
						}
						if (res.statusCode == 404) {
							uni.showToast({
								title: "上传失败",
								icon: "error"
							})
							this.isSubmit =!this.isSubmit
							return
						}
					},
					fail: (res) => {
						uni.showToast({
							title: "上传失败",
							icon: "error"
						})
						this.isSubmit =!this.isSubmit
					}
				})
			},
			getPrall() { //获取预设功能对象数据
			let pralldata = uni.getStorageSync("pralldata")
			this.preset = pralldata
				// let user = uni.getStorageSync("user")
				// let url = BASE_IP + "pc/presetfunction/find/presetFunction/" + user.unitId + "/" + user.uuid
				// uni.request({
				// 	header: {
				// 		"Authorization": user.token,
				// 	},
				// 	url: url,
				// 	success: (res) => {
				// 		this.preset = res.data
				// 	},
				// 	fail: (res) => {
				// 		// console.log("请求失败：", res)
				// 	}
				// })
			}
		},
		onLoad(ops) {
			uni.setNavigationBarTitle({
				title: "消防安全日查记录表"
			})

			let user = uni.getStorageSync("user")
			this.getPrall()
			console.log(user)
			this.regime = JSON.parse(ops.regime)
			// console.log(this.regime)
			this.inspectionStaff.name = user.nickName

			const currentDate = moment();
			const year = currentDate.year();
			const month = currentDate.month() + 1;
			const day = currentDate.date();
			this.year = year
			this.month = month + "月"
			this.day = day
			this.inspectionStaff.data = year + "-" + month + "-" + day
			let pralldata = uni.getStorageSync("pralldata")
			this.inspectionStaff.time = pralldata.operatingTimeStart + " - " + pralldata.operatingTimeEnd
			const currentTime = moment().format("HH:mm");
			this.time = currentTime
			setTimeout(() => {
				uni.showModal({
					title: "提示",
					content: "是否全部正常",
					cancelText: "否",
					confirmText: "是",
					success: (res) => {
						if (res.cancel) {
							// 获取当前时间
							const now = moment();

							// 获取年份
							const year = now.year();

							// 获取月份（从 0 开始，需要加 1）
							const month = now.month() + 1;

							// 获取日期
							const day = now.date();

							// 获取小时
							const hour = now.hour();

							// 获取分钟
							const minute = now.minute();

							let data = year + "-" + month + "-" + day + "-" + hour + "-" + minute

							this.ops.c1 = "已配齐"
							this.ops.c2 = "已执行"
							this.ops.c3 = user.nickName
							this.opsone.c1 = "已审批"
							this.opsone.c2 = "已清除"
							this.opsone.c3 = "已保持"

							this.opstow.c1 = "已配齐"
							this.opstow.c2 = "已配齐"
							this.opstow.c3 = "已配齐"
							this.opstow.c4 = "已配齐"
							this.opstow.c5 = "已配齐"
							this.opstow.c6 = "已配齐"
							this.opstow.c7 = "否"

							this.opsfour.c1 = "已配齐"
							this.opsfour.c2 = "已配齐"
							this.opsfour.c3 = "已明确"
							this.opsfour.c4 = "已配齐"
							this.opsfour.c5 = "无使用情况"

							this.opsfive.c1 = "经检查无异常情况"
							this.opsfive.c2 = "无"
							this.opsfive.c3 = data
							this.opsfive.c4 = "无"
							this.opsfive.c5 = "无"
							this.opsfive.c6 = data
							this.opsfive.c7 = "经核查无异常情况"
							return
						}
						if (res.confirm) {
							// 获取当前时间
							const now = moment();

							// 获取年份
							const year = now.year();

							// 获取月份（从 0 开始，需要加 1）
							const month = now.month() + 1;

							// 获取日期
							const day = now.date();

							// 获取小时
							const hour = now.hour();

							// 获取分钟
							const minute = now.minute();

							let data = year + "-" + month + "-" + day + "-" + hour + "-" + minute

							this.ops.c1 = "已配齐"
							this.ops.c2 = "已执行"
							this.ops.c3 = user.nickName
							this.opsone.c1 = "已审批"
							this.opsone.c2 = "已清除"
							this.opsone.c3 = "已保持"

							this.opstow.c1 = "已配齐"
							this.opstow.c2 = "已配齐"
							this.opstow.c3 = "已配齐"
							this.opstow.c4 = "已配齐"
							this.opstow.c5 = "已配齐"
							this.opstow.c6 = "已配齐"
							this.opstow.c7 = "否"

							this.opsfour.c1 = "已配齐"
							this.opsfour.c2 = "已配齐"
							this.opsfour.c3 = "已明确"
							this.opsfour.c4 = "已配齐"
							this.opsfour.c5 = "无使用情况"

							this.opsfive.c1 = "经检查无异常情况"
							this.opsfive.c2 = "无"
							this.opsfive.c3 = data
							this.opsfive.c4 = "无"
							this.opsfive.c5 = "无"
							this.opsfive.c6 = data
							this.opsfive.c7 = "经核查无异常情况"

							uni.showLoading({
								title: "正在提交"
							})
							this.submit()
						}
					}
				})
			}, 800)
			// console.log("获取当前时间：", currentTime);
		}
	}
</script>

<style>
	page {
		background-color: #F1F4FA;
	}

	.tabs {
		width: 95%;
		margin: auto;
	}

	.tab {
		width: 100%;
		background-color: white;
		border-radius: 8px;
		/* margin: auto; */
		box-shadow: 1px 1px 10px #DCDFE6;
		padding-top: 10rpx;
		padding-bottom: 20rpx;
	}

	.fui-text__explain {
		font-size: 14px;
		color: #606266;
	}

	.tab_ops {
		padding: 40rpx;
		padding: 40rpx;
	}
</style>